<script>
var dochangepara='__URL__/dochangepara';
var doqingkongdb='__URL__/doqingkongdb';
var dologinout='__APP__/Usr/dologinout';
</script>
<!--table部分-->
<div class='col-md-12 col-xs-12' style='padding-top:10px'>

    <div class="page-header">
      <h1><small>联合利华合肥厂区YG厂&nbsp;&nbsp;主操：{$usross['usrnn']}&nbsp;&nbsp;日期：{$tm}</small></h1>
    </div>

    <div class='col-md-12 col-xs-12' style="padding:10px">
    <div class='col-md-3 col-xs-3'><a class='btn btn-info' target='_blank' href='__URL__/poll'><i class='glyphicon glyphicon-play'></i> 点击后台轮询</a></div>
    <div class='col-md-2 col-xs-2'><a class='btn btn-danger' style='cursor:pointer' onclick='qingkongdb()'><i class='glyphicon glyphicon-trash'></i> 清空相关表</a></div>
    </div>

    <div class='col-md-12 col-xs-12'>
      <div class='col-md-2  col-xs-2'><a class='btn btn-success btn-lg btn-block'  href='__APP__/Usr/query'>用户列表</a></div>
      <div class='col-md-2  col-xs-2'><a class='btn btn-danger btn-lg btn-block'  href='__APP__/Part/query'>部件表①</a></div>
      <div class='col-md-3  col-xs-3'><a class='btn btn-danger btn-lg btn-block'  href='__APP__/Plan/query'>生产计划表②</a></div>
      <div class='col-md-2  col-xs-2'><a class='btn btn-success btn-lg btn-block'  href='__APP__/Item/query'>项目号表</a></div>
      <div class='col-md-3  col-xs-3'><a class='btn btn-success btn-lg btn-block'  href='__APP__/Zhucao/query'>产线基本情况表</a></div>
    </div>
    <div class='clearfix'></div>


    <div class="col-md-4 col-xs-4 panel panel-default nopadding" style="margin-top:40px">
      <div class="panel-heading">基本参数</div>
      <div class="panel-body">
        
        <div>
          <div class="form-group">
            <label for="exampleInputEmail1">最短送料间隔时间(分):</label>
            <input type="text" class="form-control" placeholder="请输入时间" value="{$parao['paraminintvaltm']}" id='paraminintvaltm'>
          </div>
          <div class="form-group">
            <label for="exampleInputPassword1">送料间隔安全比：</label>
            <input type="text" class="form-control" placeholder="请输入比例" value="{$parao['parasaferatio']}" id='parasaferatio'>
          </div>
          <div class="form-group">
            <label for="exampleInputPassword1">每次送货最大拍数:</label>
            <input type="text" class="form-control" placeholder="请输入时间" value="{$parao['paramaxpapertm']}" id='paramaxpapertm'>
          </div>
          <div class="form-group">
            <label for="exampleInputPassword1">生产计划确定最晚时间(分):</label>
            <input type="text" class="form-control" placeholder="请输入时间" value="{$parao['paralatestplandecision']}" id='paralatestplandecision'>
          </div>
          <div class="form-group">
            <label for="exampleInputPassword1">切换项目号物料提前时间(分)：</label>
            <input type="text" class="form-control" placeholder="请输入时间" value="{$parao['parachangeitempretm']}" id='parachangeitempretm'>
          </div>
          <button type="submit" class="btn btn-danger" id='changepara'>修改参数</button>
        </div>
      </div>
    </div>

    <div class='col-md-12 col-xs-12'>
      <div class='col-md-2 col-xs-2'><a class='btn btn-warning' href='#' onclick="loginout()"><i class='glyphicon glyphicon-off'></i> 注销</a></div>

    </div>


</div>

<script type="text/javascript">
$(function(){
  $('#changepara').click(function(){

    var obj=new Object();
    if($.trim($('#paraminintvaltm').val())!=''){obj['paraminintvaltm']=$.trim($('#paraminintvaltm').val());}
    if($.trim($('#parasaferatio').val())!=''){obj['parasaferatio']=$.trim($('#parasaferatio').val());}
    if($.trim($('#paramaxpapertm').val())!=''){obj['paramaxpapertm']=$.trim($('#paramaxpapertm').val());}
    if($.trim($('#paralatestplandecision').val())!=''){obj['paralatestplandecision']=$.trim($('#paralatestplandecision').val());}
    if($.trim($('#parachangeitempretm').val())!=''){obj['parachangeitempretm']=$.trim($('#parachangeitempretm').val());}

    
    $.ajax({
        'type': 'GET',
        'url':dochangepara,
        'async':false,  
        'contentType': 'application/json',
        'data': obj,
        'dataType': 'json',
        'success': function(data) {
          msg('修改成功！');
          console.log("success");
        },
        'error':function() {
            console.log("error");
        }
    });
  })
})

</script>

<script type="text/javascript">
function qingkongdb(){
  $.ajax({
      'type': 'GET',
      'url':doqingkongdb,
      'async':false,  
      'contentType': 'application/json',
      'data': {},
      'dataType': 'json',
      'success': function(data) {
        msg('已清空！');
        console.log("success");
      },
      'error':function() {
          console.log("error");
      }
  });
}
function loginout(){
  $.ajax({
      'type': 'GET',
      'url':dologinout,
      'async':false,  
      'contentType': 'application/json',
      'data': {},
      'dataType': 'json',
      'success': function(data) {
        
        window.location.reload();
      },
      'error':function() {
          console.log("error");
      }
  });
}
</script>




